# Contributor: Hazem <hazem-alpine@riseup.net>
# Maintainer: Hazem <hazem-alpine@riseup.net>
pkgname=smlsharp
pkgver=4.0.0
pkgrel=1
pkgdesc="A new programming language in the Standard ML family"
url="https://smlsharp.github.io"
arch="x86_64"
license="MIT"
_llvmver=14
depends="massivethreads-dev llvm$_llvmver"
makedepends="gmp-dev xz llvm$_llvmver-dev yajl chrpath"
source="https://github.com/smlsharp/smlsharp/releases/download/v$pkgver/smlsharp-$pkgver.tar.gz
	llvm14.patch
	"
subpackages="$pkgname-doc"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-llvm=/usr/lib/llvm$_llvmver \
		--with-incompatible-llvm
	make
}

check() {
	make test
}

package() {
	chrpath -d src/compiler/smlsharp
	make DESTDIR="$pkgdir" install
}

sha512sums="
d3c37c2c1ae4cdf75e96f7a50ae37d74b689e66f1c4db2ad9ba11ec9f5d71af37ff91a3d8d93012ba155d8674bb3c62aeec1bb4437ca8b66fbcbd958ecdf9c4d  smlsharp-4.0.0.tar.gz
c222b41db552e523d61404f9ec1bf71a37f3b6a6212b9a2e0f4c7df7efea850aa68cb7dc0a5de10fce967b4228129a4504dda0471ab4445eeb780808acc1e875  llvm14.patch
"
